home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 2003 September / PC Answers September 2003.iso / Software / trial / MonitorIT 5.2.06 / monitorit_fullsetup.exe / data1.cab / Rpm / ViewSNMPTrapDisplay.asp < prev    next >
Encoding:
Text File  |  2003-06-24  |  63.1 KB  |  1,668 lines

  1. <html>
  2. <head>
  3. <title>SNMPTrapWatch Display</title>
  4.  
  5. <link rel="stylesheet" type="text/css" href="css/rpmstyle.css">
  6. <style>
  7.  
  8. .EventFilter { border-style : solid; border-width : thin; overflow : clip; background-color:white }
  9. .EventFilter { border-top-color : graytext; border-left-color : graytext; border-bottom-color : white; border-right-color : white}
  10.  
  11. .EventLog { border-style : solid; border-width : thin; overflow : scroll;  background-color:white }
  12. .EventLog { border-top-color : graytext; border-left-color : graytext; border-bottom-color : white; border-right-color : white}
  13.  
  14. .EventConfig {  overflow : none; background-color:activeborder }
  15. .EventConfig { border-top-color : graytext; border-left-color : graytext; border-bottom-color : white; border-right-color : white}
  16.  
  17. .VASelectBox { height : 270px; width : 375px; background-color: white; color: infotext; }
  18. .VASelectBox { border-style : solid; border-width : 2px; }
  19. .VASelectBox { border-top-color : #555555; border-left-color : #555555; border-bottom-color : #E0E0E0; border-right-color : #E0E0E0}
  20.  
  21. .VAMainBox { border: none; background-color : activeborder; }
  22.  
  23. .PopUpBox { background-color:activeborder; position:absolute; margin:0; padding:0; border : solid thin; }
  24. .PopUpBox { border-top-color : #E0E0E0; border-left-color : #E0E0E0; border-bottom-color : #555555; border-right-color : #555555 }
  25.  
  26. </style>
  27. </head>
  28.  
  29. <body class="bodyc" style="margin:2px;" language="JavaScript" RPMHostIP="!BreakoutBot:MonitorIP!" RPMHostPort="!BreakoutBot:MonitorPort!" RPMUserName="!BreakoutBot:UserName!" BOBDone="!BreakoutBot:Done!" onload="top.banner.savePageCoord(event,document.body,'ViewSNMPTrapDisplay'); InitRpmCC_VA();" onbeforeunload="DiscoRpmCC_VA()" onresize="processSizeChange()" onclick="checkClick()" onkeydown="processBSP()">
  30.  
  31. <script LANGUAGE="JavaScript">
  32. <!--
  33. //border-style : solid; border-width : thin;
  34. var    VAMode = ""; // Mode of Operation, New, Edit, Delete, Lookup, ObjectLookup
  35. var    ALupMode = ""; // Lookup Mode of Operation, Computer, Counter
  36. var   AlertLupRecCount = 0; // Count of records returned from Alert Lookup operation
  37. var   AlertSelectIdx = 0; // Index of currently selected Alert 
  38. var    VA_CommBusy = 0; // Comm busy flag
  39. var    CurAlertID = ""; // Current Alert Name selected in Configure
  40. var    CurAlertName = ""; // Current Alert Group Name selected in Configure
  41. var    CurAlertDesc = ""; // Current Alert Group Description
  42. var   FilterRecCnt = 0; // Count of records in the filter
  43. var    FilterSelectIdx = 0; // Filter Select Index 
  44. var    AudioOutBusy = false; // Flag for AudioOut
  45. var   VA_Tid = null; // AudioOut free timeout
  46. var   Tid = null, CTid= null, ATid= null;
  47. var   ELogWinInit = ""; // save for ElogWin init HTML
  48. var   ELBgFlg = 0; // Alert Event Log Background color toggle
  49. var     bdH = 0;
  50. var     byM = null;
  51. var     borderSz = 2; // Thin Bord is 2pixels
  52. var     ValidateFilter = true; // Validate Alert Filter on entry
  53. var     Hp = null; // Host port
  54. var    ReconnectEvent = false;
  55.  
  56. var AC_CompStoreArr = new Array();
  57. var MostRecentHours = 3;
  58. var IsDBChange = false;
  59.  
  60. var   AlertSelectIdx = 0; // Index of currently selected Alert 
  61. var     AlertStoreArr = new Array();
  62. var   AlertLupRecCount = 0; // Count of records returned from Alert Lookup operation
  63.  
  64. // Capture and ignore script errors
  65.     window.onerror = wwScrErr;
  66. function wwScrErr() {
  67.     return true;
  68. }
  69.  
  70. /* On Load tell the Comm control to Connect to the Server */
  71. function InitRpmCC_VA() {
  72.     top.MainLoaded = true; // Flag that Main is now loaded
  73.     top.banner.savePageCoord(event,document.body,"ViewSNMPTrapDisplay");
  74.  
  75.     byM = 2*parseFloat(document.body.style.margin);
  76.     processSizeChange();
  77.  
  78.     /* get Audio Alert checkbox state */
  79.     cc = top.banner.RpmCC_Ban.RegGetKey(top.banner.ServerID+"SNMPTRapDispayAudioAlertState"); // get state
  80.     if ( cc == "unchecked" ) { // If not checked 
  81.         AlertAudioEnabled.checked = "";
  82.     }
  83.     else { 
  84.         AlertAudioEnabled.checked == "CHECKED";
  85.     }
  86.     cc = top.banner.RpmCC_Ban.RegGetKey(top.banner.ServerID+"SNMPTRapDisplayMostRecentHours"); // get hours
  87.     if ( cc != "" ) {
  88.        MostRecentHours = parseInt(cc,10);
  89.     }
  90.  
  91.       /* Connect to Server and initiate Alert Group Lookup */
  92.     Hp = parseInt(document.body.RPMHostPort,10);
  93.     RpmCC_VA.Connect(document.body.RPMHostIP,Hp, "");
  94. }
  95. function processReconnect() {
  96.     Tid = null;
  97.     if ( RpmCC_VA.IsConnected() ) {
  98.         Tid = setTimeout("processConnectionCheck()",30000); // Delay 30 secs then check connection
  99.         return;
  100.     }
  101.     RpmCC_VA.Connect(document.body.RPMHostIP,Hp, "");
  102. }
  103. function processConnectConfirmed() {
  104.     if ( ReconnectEvent == false ) {
  105.         top.banner.processStartComm(); 
  106.         processVALookupReset(); // go do Alert Lookup
  107.         processLogAndFilterWindows(); // initialize Log and Filter Windows
  108.         ReconnectEvent = true;
  109.     }
  110.     top.Rstatus.Pstat("Connected");
  111.     if ( Tid != null ) {
  112.         clearTimeout(Tid); // stop timeout routine
  113.     }
  114.     Tid = setTimeout("processConnectionCheck()",30000); // Delay 30 secs then check connection
  115. }
  116. function processConnectionCheck() {
  117.     Tid = null;
  118.     RpmCC_VA.SendKeepAlive("Check");
  119.     Tid = setTimeout("processConnectionCheck()",30000); // Delay 30 secs then check connection
  120. }
  121.  
  122. function processMostRecentHours() {
  123.     MostRecentHours = lasthours.selectedIndex;
  124.     top.banner.RpmCC_Ban.RegSetKey(top.banner.ServerID+"SNMPTRapDisplayMostRecentHours",""+MostRecentHours); // set hours
  125.     processClearButton();
  126.     processMostRecentHoursLookup();
  127. }
  128. function processMostRecentHoursLookup() {
  129.     WarningBox.style.display = "";
  130.    if ( MostRecentHours > 0 ) {
  131.        // Get Last 'N' Records
  132.         if ( RpmCC_VA.GetSnmpTrapLogRecord("GetLast"+MostRecentHours) ) {
  133.             top.Rstatus.Pstat("Unable to start the SNMP Trap Log Data Record LOOKUP request",true);
  134.         }
  135.         else {
  136.             VA_CommBusy = 1; // set Comm busy flag
  137.         }
  138.     }
  139.     else {
  140.         WarningBox.style.display = "none";
  141.         WarningBox1.style.display = "";
  142.     }
  143. }
  144.  
  145. // Process Database Change event
  146. function processDBChanged() {
  147.     CTid = null;
  148.     top.banner.processStartComm(); 
  149.     IsDBChange = true;
  150.     
  151.     // Insure Configure pop-up is hidden and disabled
  152.    //ConfigButton.className = "BoxButtonD"; // disable button
  153.    ConfigButton.disabled = "disabled"; // disable button
  154.     PopUpDiv.style.display="none";
  155.     goSaveLogEntries();
  156.     
  157.     // Clear Stores
  158.     AlertStoreArr.length = 0;
  159.     AC_CompStoreArr.length = 0;
  160.     ValidateFilter = true;
  161.     AlertSelectIdx = 0; // Reset Index of currently selected Alert 
  162.     processVALookupReset(); // go do Alert Lookup
  163.     top.Rstatus.StatDB.style.display = "none";
  164.     AL_AlertSel.style.display = "none";
  165. }
  166.  
  167. /* On Unload tell the Comm control to Disconnect from the Server */
  168. function DiscoRpmCC_VA() {
  169.     top.BannerMenuShow();
  170.     RpmCC_VA.Disconnect();
  171.     if (VA_CommBusy == 1) { // stop logo animation if Comm busy flag set
  172.         top.banner.processStopComm();
  173.     }
  174.     // Save Audio Alert checkbox state
  175.     cc = ( AlertAudioEnabled.checked == false ) ? "unchecked" : "checked";
  176.     top.banner.RpmCC_Ban.RegSetKey(top.banner.ServerID+"SNMPTRapDispayAudioAlertState",cc); // set state
  177.     processClearButton();
  178.     WarningBox.style.display = "";
  179.     goSaveLogEntries();
  180.         
  181.     /* Clear AudioOut Timer if set */
  182.     if ( VA_Tid != null ) {
  183.         clearTimeout(VA_Tid);
  184.     }
  185.     if ( Tid != null ) {
  186.         clearTimeout(Tid);
  187.     }
  188.     if ( CTid != null ) {
  189.         clearTimeout(CTid);
  190.     }
  191.     if ( ATid != null ) {
  192.         clearTimeout(ATid);
  193.     }
  194. }
  195. function goSaveLogEntries() {
  196.     /* Redefine Log Time based on Current Time */
  197.     var dob = new Date(); // get current d/t
  198.     var lt = (dob.getMonth()+1) + "/" + dob.getDate() + "/" + dob.getFullYear();
  199.     lt += " " + dob.getHours() + ":" + dob.getMinutes() + ":" + dob.getSeconds();
  200.     ELogParams.logtime = lt; // update the D/T stamp    
  201.     ELogParams.ELBgFlg = ELBgFlg; // save background flag
  202.     
  203.     /* Save the Log Display, and Filter Display & Store on the Banner Page before exiting */
  204.     top.banner.saveLogDisplay(ELogWin.innerHTML);
  205.     top.banner.saveLogFilter(ELogViewCur.innerHTML);
  206.     AL_AlertSel.innerText = ""; // clear
  207. }
  208.  
  209. // Process Display View Size Change
  210. var SCbsy = false;
  211. var PuPW = "500px", PuPWu=500, PuPH = "280px", PuPHu=280, PuPCH = "235px";
  212. var VFilW = "630px"
  213. function processSizeChange() {
  214.     if ( SCbsy ) 
  215.         return;
  216.     SCbsy = true;
  217.     // Display Height and Width
  218.     bCh = document.body.clientHeight;
  219.     bCw = document.body.clientWidth;
  220.  
  221.     // Determine minimums
  222.     bCh = (bCh < bdH+byM+270) ? bdH+byM+270 : bCh;
  223.     bCw = (bCw < PuPWu) ? PuPWu : bCw;
  224.    document.body.scroll = (bCw <= PuPWu || bCh <= bdH+byM+270) ? "yes" : "no";
  225.    
  226.    // Set Height/Widths for Chart and Button areas
  227.     VA_MainBox.style.height = bCh-(bdH+byM-borderSz)-10;
  228.     VA_MainBox.style.width = bCw-byM-4;
  229.     VA_MainBox.style.display = "";
  230.  
  231.     ELogWinFullH = "" + (bCh-TitleDivSize);    
  232.     var ELWinc = (bCh-TitleDivSize-175);
  233.     ELWinc = (ELWinc < 0) ? 0 : ELWinc;
  234.     ELogWinSplitH = "" + ELWinc;    
  235.     ELogWin.style.height = ( ELogViewCurLine.style.display == "none" ) ? ELogWinFullH : ELogWinSplitH;
  236.     
  237.     ELogViewCur.style.width = (bCw-byM-34 > 530) ? "530px" : bCw-byM-34;
  238.  
  239.     //PopUpContext Menu
  240.    PopUpContextSize(bCw);
  241.     
  242.    // PopUp 
  243.    PuPLeft = (bCw-PuPWu)/2;
  244.    PuPTop = (bCh-PuPHu)/2;
  245.    PopUpDiv.style.left = PuPLeft+"px"; 
  246.    PopUpDiv.style.top = "25px";
  247.    PopUpDiv.style.height = (bCh-110);
  248.    PopUpDiv.style.width = PuPW;
  249.    VA_Select.style.height = (bCh-130);
  250.     SCbsy = false;
  251. }
  252.  
  253. /* Initial Alert Lookup Request */
  254. function processVALookupReset() {
  255.     AlertLupRecCount = 0; // clear Lookup record counter
  256.     if ( RpmCC_VA.AlertGroupLookup("*") ) {
  257.         top.Rstatus.Pstat("Unable to start the Alert LOOKUP request",true);
  258.         processResetButton();
  259.     }
  260.     else {
  261.         VA_CommBusy = 1; // set Comm busy flag
  262.         top.Rstatus.Pstat("One moment while Alert LOOKUP request completes");
  263.     }
  264. }
  265.  
  266. /* Alert Lookup Op Complete */
  267. function processAlertOpComplete() {
  268.     AL_AlertSel.style.display = "none"; // insure hidden
  269.     if (AlertLupRecCount == 0) { // check if any records found
  270.          top.Rstatus.Pstat("No record matches found for Alert LOOKUP request",true);    
  271.         WarningBox.style.display = "none";
  272.         WarningBox1.style.display = "";
  273.      }
  274.      else {
  275.         for (var i=0; i < AlertStoreArr.length; i+=AlertRecLength) {
  276.             if ( AlertStoreArr[i+8] == "01/01/1999 11:20:00" 
  277.                    || AlertStoreArr[i+8] == "1/1/1999 11:20:0" ) {
  278.                    // Keep SNMPTrap Alert
  279.             }
  280.             else { // Otherwise delete all other Alert types
  281.                 AL_AlertSel.remove(i/AlertRecLength);
  282.                 var idx = i;
  283.                 for (var j = idx+AlertRecLength; j < AlertStoreArr.length; ++idx, ++j) {
  284.                     AlertStoreArr[idx] = AlertStoreArr[j];
  285.                 }
  286.                 i -= AlertRecLength;
  287.                 AlertStoreArr.length -= AlertRecLength;                
  288.             }
  289.         }
  290.         // Do TrapMonitor Record Lookup
  291.         ALupMode = "TrapMonitorLookup";
  292.         rstat = RpmCC_VA.EnumSnmpTrapMonitor();    
  293.         if ( rstat ) { // if unable to initiate request    
  294.             ALupMode = ""; // reset
  295.             top.Rstatus.Pstat("Unable to start the SNMP Trap LOOKUP request",true);
  296.         }
  297.         else { // waiting for OperationCompleteEvent
  298.             top.Rstatus.Pstat("One moment while SNMP Trap LOOKUP request completes");
  299.             return;
  300.         }
  301.      }
  302.     processResetButton();    
  303. }
  304.  
  305. // Print Log
  306. var DiscStatWindow = null;
  307. function processPrintStatus() {
  308.     if ( !top.banner.IE55orBetter ) {
  309.         alert("Print requires IE 5.5/SP1 or greater. Download current, free IE update from Microsoft's web site");
  310.         return;
  311.     }
  312.     FakeBut.click();    // simulate event to call "savePageCoord(...)"
  313.     var wprop = "height="+top.banner.bCh+",width="+top.banner.bCw
  314.     wprop += ",top="+(top.banner.bY-28)+",left="+(top.banner.bX-4)+",scrollbars";
  315.     var rName = ""+Math.random(); // use Random number to get unique Window name
  316.     rName = rName.substring(2,rName.length);
  317.     DiscStatWindow = window.open("",rName,wprop);
  318.     if ( DiscStatWindow == null ) {
  319.         return;   
  320.     }
  321.     var dh = "<html><head><title>MonitorIT - SNMPTrapWatch Display Report</title>";
  322.     dh += "<link rel='stylesheet' type='text/css' href='css/rpmstyle.css'></head><body";
  323.     dh += " title='Exit to Close Window when Printing is complete'>"; 
  324.     dh += ELogWin.innerHTML;
  325.     dh += '<script LANGUAGE="JavaScript">ploghdr.border="1"; ploghdr1.width="158"; ploghdr2.width="228"; ploghdr3.width="104"; window.focus();';
  326.     dh += ' </script></body></html>';
  327.     DiscStatWindow.document.open();
  328.     DiscStatWindow.document.write(dh)
  329.     DiscStatWindow.document.close();
  330.     DiscStatWindow.print();
  331. }
  332.  
  333. /* Initialize the Log and Filter Windows */
  334. function processLogAndFilterWindows() {
  335.     var    hs = "";
  336.     outputLogWindowHeader();
  337.      ELogWinInit = ELogWin.innerHTML; // save for clear log
  338.     outputFilterWindowHeader();
  339.     /* Restore the Log Display if Previously Saved */
  340.     hs = top.banner.restoreLogDisplay();
  341.     if ( hs != "" ) { 
  342.         ELogWin.innerHTML = hs;
  343.         ELBgFlg = ELogParams.ELBgFlg; // restore
  344.     } 
  345.     /* Restore the Filter Display and Storage if Previously Saved */
  346.     hs = RpmCC_VA.RegGetKey(top.banner.ServerID+"SNMPTrapDisplayLogFilterSave");
  347.     if ( hs != "" ) {
  348.         ELogViewCur.innerHTML = hs;
  349.         FilterRecCnt = VA_FilterStore.length / FilterRecSize;
  350.     } 
  351. }
  352. function outputLogWindowHeader() {
  353.     /* Format Output to Log Window */
  354.     FOps = "<table id='ploghdr' border='0' cellpadding='0' cellSpacing='1' width='100%'>";
  355.     FOps += "<tr><td id='ploghdr1' width='160' colspan='1' align='center' style='background-color:activeborder' class='optextb'>";
  356.     FOps += "Server/Device Name" + "</td>";
  357.     FOps += "<td id='ploghdr2' width='230' colspan='1' align='center' style='background-color:activeborder' class='optextb'>";
  358.     FOps += "Trap Type" + "</td>";
  359.     FOps += "<td id='ploghdr3' width='104' colspan='1' align='center' style='background-color:activeborder' class='optextb'>";
  360.     FOps += "Date/Time Stamp" + "</td>";
  361.     FOps += "<td width='*' colspan='1' align='center' style='background-color:activeborder' class='optextb'>";
  362.     FOps += "Variable Bindings" + "</td>";
  363.     FOps += "</tr></table>";
  364.      WarningBox.style.display = "";    
  365.     ELogWin.insertAdjacentHTML("afterBegin",FOps);
  366. }
  367.  
  368. function outputFilterWindowHeader() {
  369.     /* Format Output to Filter Window */
  370.     FOps = "<table border='0' cellpadding='0' cellSpacing='1' width='500'>";
  371.     FOps += "<tr><td width='50%' colspan='1' align='center' style='background-color:activeborder' class='optextb'>";
  372.     FOps += "Watch/Alert Name" + "</td>";
  373.     FOps += "<td width='50%' colspan='1' align='center' style='background-color:activeborder' class='optextb'>";
  374.     FOps += "Watch/Alert Type" + "</td>";
  375.     FOps += "</tr></table>";
  376.     ELogViewCur.insertAdjacentHTML("beforeEnd",FOps);
  377. }
  378.  
  379. // Process the Unsolicited Alerts that were Accumulated
  380. function processAccumulatedAlerts() {
  381.     var    PrevAgid = "", hs = null;
  382.     /* Get and process the Unsolicited Alerts accumulated */
  383.       var Tflg = ELogParams.logtime; // Time stamp of last Log entry
  384.       if ( Tflg == "0" ) { // get Start Time for Client
  385.        Tflg = top.banner.getLogStartTime();
  386.        ELogParams.logtime = Tflg;
  387.    }
  388.        
  389.    // Get SNMP Trap Alerts
  390.     PrevAgid = ""; // reinitialize
  391.     Uaa = top.banner.getUnsolicitedSNMPAlertArray(); 
  392.     top.banner.enableUnsolicitedSNMPAlerts();
  393.     UaaArray = Uaa.split(","); // Parse out the AlertGroupIDs~TrapLogRecID
  394.     for ( var i=0; i<UaaArray.length; i++ ) {
  395.        hs = UaaArray[i]; // get an AlertGrp ID~TrapLogRecID
  396.        if ( hs != PrevAgid ) { // if same as previous, skip it
  397.            processUnsolicitedSNMPAlertEvent(hs,Tflg);
  398.            PrevAgid = hs; // set as Previous   
  399.         }
  400.     }
  401.     if ( ELogParams.logeventid != "" ) {
  402.        //ClearButton.className = "BoxButton"; // enable button
  403.        ClearButton.disabled = ""; // enable button   
  404.     }
  405. }
  406.  
  407. /* Play specified WAV file as an AudioAlert */
  408. function processAlertAudioOut() {
  409.     if ( AlertAudioEnabled.checked == false || AudioOutBusy == true )
  410.         return; // exit if not enabled or Busy
  411.     RpmCC_VA.DoMessageBeep(0x40); // System Asterisk
  412. }
  413. function freeAudioOut() {
  414.     AudioOutBusy = false;
  415. }
  416.  
  417.  
  418. /* Process the Unsolicited SNMP Trap Alert Event */
  419. function processUnsolicitedSNMPAlertEvent(AGID_STLID,Tflg) {
  420.     var warr = new Array();
  421.     warr = AGID_STLID.split("~"); // split out Alert Grp ID and Trap Log Record ID
  422.     if ( CheckAlertFilter(warr[0],Tflg) == false ) 
  423.         return; // if not in filter
  424.     /* Initiate Read of SNMP Trap Data */
  425.     if ( RpmCC_VA.GetSnmpTrapLogRecord(warr[1]) ) {
  426.         top.Rstatus.Pstat("Unable to start the SNMP Trap Log Data Record LOOKUP request",true);
  427.     }
  428.     else {
  429.         VA_CommBusy = 1; // set Comm busy flag
  430.     }
  431. }
  432. // SNMP Trap Alert Log Record
  433. var ServEventRecLth = 2;
  434. function processAlertSNMPRecord(LogRecStrg) {
  435.       var SLRec = new Array();
  436.       SLRec = LogRecStrg.split("~"); // parse the Log Record
  437.       var TMix = getTrapMonitorIX(SLRec[6]); // get Trap Monitor Storage Index 
  438.       if ( TMix < 0 )
  439.           return; // not found
  440.     //var dob = new Date(); // get current d/t
  441.     //var lst = (dob.getMonth()+1) + "/" + dob.getDate() + "/" + dob.getFullYear();
  442.     //var chrs = (dob.getHours() < 10) ? "0"+dob.getHours() : dob.getHours();
  443.     //lst += " " + chrs + ":" + dob.getMinutes() + ":" + dob.getSeconds();
  444.     //SLRec[5]=lst; //sunstitute time
  445.     LogRecStrg = SLRec.join("~");
  446.   
  447.       // Alert Group ID, Computer ID, Time Stamp
  448.     if ( IsDisplayInLog(AC_TrapMonitorStore[TMix+2].text,AC_TrapMonitorStore[TMix+1].text,SLRec[5]) == false )
  449.         return; // Didn't pass filter test
  450.  
  451.     /* Check for duplicate by comparing versus Event ID array */
  452.     var EidArr = new Array();     
  453.     EidArr = ELogParams.logeventid.split(",");
  454.     Eid = SLRec[0]+"~"+SLRec[6]; // Event ID = TrapMonitorLogRecID~TrapMonitorID
  455.     for ( var i=0; i<EidArr.length; i++ ) {
  456.         if ( Eid == EidArr[i] ) // if match then duplicate
  457.               return;
  458.     }
  459.     var CompID = AC_TrapMonitorStore[TMix+1].text; // Computer ID
  460.     // Save SNMP Trap Record string in temporary store
  461.     addElementToSelect(VA_ServEventStore,CompID); //+0
  462.     var lrs = LogRecStrg +"~"+AC_TrapMonitorStore[TMix+2].text+"~"+AC_TrapMonitorStore[TMix+1].text;
  463.     addElementToSelect(VA_ServEventStore,"SNMPTrap~"+lrs);
  464.  
  465.     /* Lookup Computer Name and Description */
  466.     if ( ALupMode != "AlertEvent" ) { 
  467.     // if read not already in progress, 
  468.         goCheckServEventStore();
  469.     }
  470. }
  471. // Find Index to TrapMonitor Record Store based on TrapMonitor ID
  472. function getTrapMonitorIX(TMid) {
  473.     for ( var i=0; i<AC_TrapMonitorStore.length; i+=TrapMonRecSize ) {
  474.        if ( AC_TrapMonitorStore[i].text == TMid) {
  475.            break;
  476.        }
  477.    }
  478.    // if found
  479.    var retv =  ( i <AC_TrapMonitorStore.length )? i : -1;
  480.    return retv;    
  481. }
  482.  
  483. var curServAlertCompNme = null;
  484. var curServAlertCompDesc = null;
  485. function processAlertServicesComputerLookup(CID,CNME,CDESC) {
  486.     curServAlertCompNme = CNME; // save Computer Name and Description
  487.     curServAlertCompDesc = CDESC;
  488.     goProcessLogRec(CID); // go process log record
  489.     goCheckServEventStore();
  490. }
  491. function goCheckServEventStore() {
  492.     var CompID = null; 
  493.     while ( VA_ServEventStore.length > 0 ) {
  494.         CompID = VA_ServEventStore.options[0].text; // get next entry
  495.         if ( getCompNameDesc(CompID) ) { // see if Computer already in local store
  496.             if ( !goProcessLogRec(CompID) ) // yes-go process immediately
  497.                 break;
  498.         }
  499.         else if ( !RpmCC_VA.ComputerLookupByIDArray(CompID) ) {
  500.             ALupMode = "AlertEvent"; 
  501.             VA_CommBusy = 1; // set Comm busy flag
  502.             return true; // exit now
  503.         }
  504.     }
  505.     ALupMode = ""; // reset
  506.     return false;
  507. }
  508. function    goProcessLogRec(CmpID) { //  process log record
  509.     /* Get Log Record from Store based on Computer ID */
  510.     for (var i=0; i < VA_ServEventStore.length; i+=ServEventRecLth) {
  511.         if ( VA_ServEventStore.options[i].text == CmpID ) {
  512.             outputLogEvent(null,VA_ServEventStore.options[i+1].text); // go process
  513.             for ( var j=0; j<ServEventRecLth; j++ ) { // remove from temporary store
  514.                 VA_ServEventStore.remove(i);   
  515.             }
  516.             return true;
  517.           }
  518.     }
  519.     return false;
  520. }
  521. /* Check Filter for Eligible Alert */
  522. function CheckAlertFilter(Agid,Tflg) {
  523.     if ( Tflg == null ) { // set serach time for Event if not specified
  524.        Tflg = ELogParams.logtime;
  525.           if ( Tflg == "0" ) { // get Start Time for Client
  526.            Tflg = top.banner.getLogStartTime();
  527.            ELogParams.logtime = Tflg;
  528.        }
  529.     }
  530.     return IsDisplayInLog(Agid,null,Tflg);// check if in Filter
  531. }        
  532.  
  533. /* Process Clear Log button click */
  534. function processClearButton() {
  535.     ELogWin.innerHTML = ELogWinInit; // clear log
  536.     WarningBox.style.display = "none";
  537.     /* Redefine Log Time based on Current Time */
  538.     var dob = new Date(); // get current d/t
  539.     var lt = (dob.getMonth()+1) + "/" + dob.getDate() + "/" + dob.getFullYear();
  540.     lt += " " + dob.getHours() + ":" + dob.getMinutes() + ":" + dob.getSeconds();
  541.     ELogParams.logtime = lt; // update the D/T stamp    
  542.     ELBgFlg = 0;
  543.    //ClearButton.className = "BoxButtonD"; // disable button
  544.    ClearButton.disabled = "disabled"; // disable button   
  545.    //StatusPrintButton.className = "BoxButtonD"; // disable button
  546.    StatusPrintButton.disabled = "disabled"; // disable button   
  547. }
  548.  
  549. /* Process Configure Button Click */
  550. function processConfigureButton() {
  551.     if ( ALupMode == "AlertEvent" )
  552.         return; // ignore, currently doing Computer Lookup
  553.    //ConfigButton.className = "BoxButtonD"; // disable button
  554.    ConfigButton.disabled = "disabled"; // disable button
  555.     PopUpDiv.style.display="";
  556.     AL_AlertSel.style.display = "";
  557.     if ( AL_AlertSel.length > 0 ) {
  558.         AL_AlertSel.options[0].selected = "selected";
  559.         populateInput(0);
  560.     }
  561.  
  562.     if ( lasthours.length == 0 ) {
  563.         for ( var i=0; i<25; i++ ) {
  564.             stxt = ""+i;
  565.             el = addElementToSelect(lasthours,stxt);
  566.             if ( i == MostRecentHours ) {
  567.                el.selected = "selected";
  568.             }
  569.         }
  570.     }
  571. }
  572.  
  573. function processDoneButton() {
  574.     ALupMode = ""; // reset
  575.     RpmCC_VA.RegSetKey(top.banner.ServerID+"SNMPTrapDisplayLogFilterSave",ELogViewCur.innerHTML)
  576.     AL_AlertSel.style.display = "none";
  577.     PopUpDiv.style.display = "none";
  578.    //ConfigButton.className = "BoxButton"; // enable button
  579.    ConfigButton.disabled = ""; // enable button   
  580.     top.Rstatus.Pstat("");
  581. }
  582.  
  583. /* Process ViewCurrent and Hide Current Log Filter Button Clicks */
  584. function processViewCurrentButton() {
  585.       ELogWin.style.height=ELogWinSplitH;
  586.    vct = ELogViewCurLine.innerHTML;
  587.     ELogViewCurLine.style.display="";
  588.     ELogViewCurLine.innerHTML = vct;
  589.    //ViewCurrentButton.className = "BoxButtonD"; // disable button
  590.    ViewCurrentButton.disabled = "disabled"; // disable button
  591.     ELogViewCurLine.scrollIntoView(false);
  592. }
  593.  
  594. function processHideCurrentButton() {
  595.       ELogWin.style.height=ELogWinFullH;
  596.     ELogViewCurLine.style.display="none";
  597.    //ViewCurrentButton.className = "BoxButton"; // enable button
  598.    ViewCurrentButton.disabled = ""; // disable button
  599. }
  600.  
  601. /* Process Update Log Filter and Window */
  602. function processUpdateLogFilter(FilOp) {
  603.     if ( FilOp == "add" ) { // Add an entry to the Current View
  604.          FOps = "<div agrpid='" + CurAlertID + "' onclick='processLogFilterClick(this)' id='lf";
  605.          FOps += CurAlertID + "' style='background-color:white; cursor:hand'>"
  606.     }
  607.     else { // otherwise, Update an entry in the Current View
  608.           Fo = document.all["lf"+CurAlertID];
  609.         Fo.innerHTML = ""; // clear entry 
  610.         FOps = "";
  611.     }
  612.  
  613.     Fcon = "SNMPTrap"; 
  614.     if ( Fcon.length > 47 ) { // Object : Name
  615.         FconT = Fcon; // set for display in the title
  616.         Fcon = Fcon.substring(0,46) + "...";   
  617.     }
  618.     else {
  619.        FconT = ""; 
  620.     }
  621.     FconDesc = "";
  622.  
  623.     /* Output Parameters */
  624.     FOps += "<table border='0' cellpadding='0' cellSpacing='1' width='500'>";
  625.     FOps += "<tr><td width='50%' align='left' class='optext' style='cursor:hand' title='" + CurAlertDesc + "'>";
  626.     FOps += CurAlertName + "</td>";
  627.     FOps += "<td width='50%' align='left' class='optext' style='cursor:hand' title='" + FconT + FconDesc + "'>";
  628.     FOps += Fcon + "</td>";
  629.     FOps += "</tr></table>";
  630.  
  631.     if ( FilOp == "add" ) {
  632.         FOps += "</div>";
  633.         ELogViewCur.style.overflow = ( FilterRecCnt > 5 ) ? "scroll" : "";
  634.         ELogViewCur.insertAdjacentHTML("beforeEnd",FOps);
  635.     }
  636.     else {
  637.         Fo.insertAdjacentHTML("beforeEnd",FOps);
  638.     }
  639. }
  640.  
  641. /* Process Click on an Entry in the Log Filter Current View */
  642. var CurLflSelected = null;
  643. function processLogFilterClick(LFobj) {
  644.     if ( CurLflSelected != null ) {
  645.        document.all[CurLflSelected].style.backgroundColor = "white";
  646.     }
  647.     if ( CurLflSelected == LFobj.id ) { // if same line
  648.         //VC_DeleteButton.className = "BoxButtonD";
  649.         VC_DeleteButton.disabled = "disabled";
  650.         CurLflSelected = null;
  651.     }
  652.     else {
  653.         CurLflSelected = LFobj.id;
  654.         LFobj.style.backgroundColor = "scrollbar";
  655.         //VC_DeleteButton.className = "BoxButton";
  656.         VC_DeleteButton.disabled = "";
  657.     }
  658. }
  659.  
  660. /* Process Delete Button Click */
  661. function processDeleteEntryButton() {
  662.     if ( CurLflSelected != null ) { // if an entry is highlited
  663.         // delete highlited entry
  664.         CAid = document.all[CurLflSelected].agrpid; // get AlertGrp ID
  665.        document.all[CurLflSelected].outerText = ""; // clear entry
  666.         CurLflSelected = null; // reset to no selected entry
  667.           //VC_DeleteButton.className = "BoxButtonD"; // disable Delete button
  668.           VC_DeleteButton.disabled = "disabled"; // disable Delete button
  669.       
  670.        // clear entry from the Filter Store
  671.         FilObj = VA_FilterStore; // Filter Store
  672.         if ( getFilterEntry(CAid) == null ) // Find index to the entry in the Store
  673.             return; // if entry not found
  674.         for ( var i=0; i<FilterRecSize; i++ ) { // remove entry from the Store
  675.             FilObj.remove(FilterSelectIdx);
  676.         }
  677.        --FilterRecCnt; // adjust count
  678.         ELogViewCur.style.overflow = ( FilterRecCnt > 5 ) ? "scroll" : "";
  679.        // update save in Registry
  680.         RpmCC_VA.RegSetKey(top.banner.ServerID+"SNMPTrapDisplayLogFilterSave",ELogViewCur.innerHTML)
  681.    }
  682. }
  683.  
  684. /* Process Show Event Button Click */
  685. var   FilterRecSize = 7; // Filter Record size
  686. function processApplyButton() {
  687.     var Scid = ""; // Computer ID Array
  688.     /* Create an array of selected computers */
  689.     for ( var i=0, j=0; i<CountOfComps; i++ ) { // Test each computer for Checked
  690.         if ( document.all["cmpa_"+i].checked == "1" ) {
  691.             if ( j > 0) {
  692.                   Scid += ","; // array id separator
  693.             }
  694.             Scid += document.all["cmpa_"+i].cmpid; // save Computer ID
  695.             ++j;
  696.         }
  697.     }
  698.     if ( j == 0 ) {
  699.         CurLflSelected = "lf"+CurAlertID;
  700.         processDeleteEntryButton();
  701.           return;
  702.     }
  703.  
  704.     var nd = new Array();
  705.     ASdt = VA_StartDate.value; // Get Start Date
  706.     AEdt = VA_StopDate.value; // Get End Date
  707.     nd = ASdt.split(" ");
  708.     ASdt = nd[3] + " " + "0:0:0";
  709.     var Dob = new Date(ASdt); // Date object
  710.     Sms = Dob.getTime(); // Milliseconds since 1/1/70 0:0:0
  711.  
  712.     nd = AEdt.split(" ");
  713.     AEdt = nd[3] + " " + "23:59:59";
  714.     Dob = new Date(AEdt);
  715.     Ems = Dob.getTime(); // Milliseconds since 1/1/70 0:0:0
  716.  
  717.     /* See if entry already exists in the filter */
  718.     FilObj = VA_FilterStore; // Filter Store
  719.     if ( getFilterEntry(CurAlertID) != null ) { // if entry already in the filter
  720.         FilOp = "repl"; // Filter Update Op is Replace
  721.         i = FilterSelectIdx; // index to found entry
  722.         FilObj.options[i+1].text = Scid;    
  723.         FilObj.options[i+2].text = ASdt;
  724.         FilObj.options[i+3].text = Sms;    
  725.         FilObj.options[i+4].text = AEdt;    
  726.         FilObj.options[i+5].text = Ems;    
  727.         FilObj.options[i+6].text = curServName; // current Service Name if Service    
  728.     }
  729.     else { // otherwise, not yet in the Filter Store
  730.         FilOp = "add"; // Filter Update Op is Add
  731.         addElementToSelect(FilObj,CurAlertID); 
  732.         addElementToSelect(FilObj,Scid); 
  733.         addElementToSelect(FilObj,ASdt);
  734.         addElementToSelect(FilObj,Sms);
  735.         addElementToSelect(FilObj,AEdt);
  736.         addElementToSelect(FilObj,Ems);
  737.         addElementToSelect(FilObj,curServName); // current Service Name if Service
  738.         ++FilterRecCnt; // bump record count
  739.     }
  740.     /* Update Log Filter Window */
  741.     processUpdateLogFilter(FilOp);
  742.     
  743.     if ( AL_AlertSel.style.display == "" && AL_AlertSel.style.visibility != "hidden") {
  744.         AL_AlertSel.focus(); // restore focus
  745.     }
  746. }
  747.  
  748. /* Search Filter Store for Given Alert Group ID */
  749. function getFilterEntry(AGID) {
  750.     FilObj = VA_FilterStore; // Filter Store
  751.     FilMax = FilterRecCnt * FilterRecSize;
  752.     for ( i=0; i<FilMax; i+=FilterRecSize ) {
  753.         if ( AGID == FilObj.options[i].text ) {
  754.             FilterSelectIdx = i; // save index
  755.             return i;
  756.         }
  757.     }
  758.     return null;
  759. }
  760.  
  761. // Validate Alert Filter
  762. function processValidateFilter() {
  763.     if ( ValidateFilter == false ) 
  764.         return; // exit if not needed
  765.     ValidateFilter = false; // reset
  766.     for ( var i=0; i<VA_FilterStore.length; i+=FilterRecSize ) {
  767.         // Check for valid Alert Group ID and that End D/T is greater than current D/T
  768.         if ( !IsValidAlertGroup(VA_FilterStore.options[i].text) ) {
  769.             // remove entry from Filter display
  770.            document.all["lf"+VA_FilterStore.options[i].text].outerText = ""; 
  771.              // remove entry from the Store
  772.             for ( var j=0; j<FilterRecSize; j++ ) {
  773.                 VA_FilterStore.remove(i);
  774.             }
  775.               --FilterRecCnt; // adjust count
  776.               i -= FilterRecSize; // adjust index for just deleted entry
  777.        }
  778.    }
  779.     ELogViewCur.style.overflow = ( FilterRecCnt > 5 ) ? "scroll" : "";
  780.       // update save in Registry
  781.     RpmCC_VA.RegSetKey(top.banner.ServerID+"SNMPTrapDisplayLogFilterSave",ELogViewCur.innerHTML)
  782. }
  783. /* Check if Valid Alert Group ID */
  784. function IsValidAlertGroup(UID) {
  785.     for (var i=0; i < AlertStoreArr.length; i+=AlertRecLength) {
  786.         if ( AlertStoreArr[i+1] == UID ) {
  787.             return true;
  788.         }
  789.     }
  790.     return false;
  791. }
  792.  
  793.  
  794. /* Search Filter and Determine If Event Should Be Displayed */
  795. function IsDisplayInLog(AGID,CID,TS) {
  796.     // check if entry in Filter for Alert Group ID
  797.     if ( VA_FilterStore.length == 0 ) {
  798.         return true; // defaultto show everthing if no filter
  799.     }
  800.     if ( getFilterEntry(AGID) == null ) 
  801.          return false; // not in Filter
  802.  
  803.     // check if Computer ID in Array of Found Filter entry
  804.     if ( CID != null ) {
  805.         var CaR = new Array();
  806.         FilObj = VA_FilterStore; // Filter Store
  807.         CaR = FilObj.options[FilterSelectIdx+1].text.split(","); // Comp ID array
  808.         for ( var i=0; i<CaR.length; ++i ) {
  809.             if ( CID == CaR[i] ) // if match on Comp ID
  810.                 break;
  811.         }
  812.         if ( i>=CaR.length )
  813.              return false; // not in Filter
  814.      }
  815.          
  816.     // Specified parameters match a Filter entry
  817.     return true;
  818. }
  819.  
  820. var   EventRecCount = 0; // Count of temporary Event records 
  821. var    EventRecLength = 18; // Event record length
  822. var     EventSelectIdx = 0;
  823. function AlertEventLupRec1(EvID, EvTimStmp, EvValue, EvThresh, EvOver, EvDur, EvEmNotify, EvPhNotify, EvProNotify, EvPgNotify, EvObjNme, EvCntNme, EvCmpNme) {
  824.     StoreObj = VA_EventStore; // Storage
  825.     if ( IsEventExist(EvID) == false ) { // if not received yet
  826.         addElementToSelect(StoreObj,EvID); //+0
  827.         addElementToSelect(StoreObj,EvTimStmp);
  828.         addElementToSelect(StoreObj,EvCntNme);
  829.         addElementToSelect(StoreObj,EvObjNme);
  830.         addElementToSelect(StoreObj,EvCmpNme); 
  831.         addElementToSelect(StoreObj,EvValue); //+5
  832.         addElementToSelect(StoreObj,EvEmNotify); 
  833.         addElementToSelect(StoreObj,EvPhNotify); 
  834.         addElementToSelect(StoreObj,EvProNotify); 
  835.         addElementToSelect(StoreObj,EvPgNotify); //+9
  836.         addElementToSelect(StoreObj,EvThresh); 
  837.         addElementToSelect(StoreObj,EvOver); 
  838.         addElementToSelect(StoreObj,EvDur); //+12
  839.         /* allocate space for Part 2 */
  840.         addElementToSelect(StoreObj,""); //+13
  841.         addElementToSelect(StoreObj,"");
  842.         addElementToSelect(StoreObj,"");
  843.         addElementToSelect(StoreObj,"");
  844.         addElementToSelect(StoreObj,""); //+17
  845.     }
  846.     else { // already received Part 2, update Part 1
  847.         ESix = EventSelectIdx * EventRecLength;
  848.         StoreObj.options[ESix+0].text = EvID;
  849.         StoreObj.options[ESix+1].text = EvTimStmp;
  850.         StoreObj.options[ESix+2].text = EvCntNme;
  851.         StoreObj.options[ESix+3].text = EvObjNme;
  852.         StoreObj.options[ESix+4].text = EvCmpNme;
  853.         StoreObj.options[ESix+5].text = EvValue;
  854.         StoreObj.options[ESix+6].text = EvEmNotify; 
  855.         StoreObj.options[ESix+7].text = EvPhNotify; 
  856.         StoreObj.options[ESix+8].text = EvProNotify; 
  857.         StoreObj.options[ESix+9].text = EvPgNotify; //+9
  858.         StoreObj.options[ESix+10].text = EvThresh; 
  859.         StoreObj.options[ESix+11].text = EvOver; 
  860.         StoreObj.options[ESix+12].text = EvDur; //+12
  861.         outputLogEvent(StoreObj,ESix); // go output to Log Window if eligible
  862.         for ( var i=0; i<EventRecLength; i++ ) { // remove from temporary store
  863.             StoreObj.remove(ESix);   
  864.         }
  865.     }
  866. }
  867.  
  868. function AlertEventLupRec2(EvID, EvAlertID, EvValueID, EvAlGrpID, EvObjID, EvCntrID, EvCmpID, EvGrpID, EvServerID, EvObjDesc, EvCntrDesc, EvCmpDesc, EvOSver) {
  869.     StoreObj = VA_EventStore; // Storage
  870.     if ( IsEventExist(EvID) == false ) { // if not received yet
  871.         // allocate space for Part 1
  872.         addElementToSelect(StoreObj,EvID); //+0
  873.         addElementToSelect(StoreObj,"");
  874.         addElementToSelect(StoreObj,"");
  875.         addElementToSelect(StoreObj,"");
  876.         addElementToSelect(StoreObj,""); 
  877.         addElementToSelect(StoreObj,""); //+5
  878.         addElementToSelect(StoreObj,""); 
  879.         addElementToSelect(StoreObj,""); 
  880.         addElementToSelect(StoreObj,""); 
  881.         addElementToSelect(StoreObj,""); //+9
  882.         addElementToSelect(StoreObj,""); 
  883.         addElementToSelect(StoreObj,""); 
  884.         addElementToSelect(StoreObj,""); //+12 
  885.         /* save Part 2 */
  886.         addElementToSelect(StoreObj,EvCmpID); //+13
  887.         addElementToSelect(StoreObj,EvAlGrpID); 
  888.         addElementToSelect(StoreObj,EvObjDesc);
  889.         addElementToSelect(StoreObj,EvCntrDesc);
  890.         addElementToSelect(StoreObj,EvCmpDesc); //+17
  891.     }
  892.     else { // already received Part 1, update Part 2
  893.         ESix = EventSelectIdx * EventRecLength;
  894.         StoreObj.options[ESix+13].text = EvCmpID;
  895.         StoreObj.options[ESix+14].text = EvAlGrpID;
  896.         StoreObj.options[ESix+15].text = EvObjDesc;
  897.         StoreObj.options[ESix+16].text = EvCntrDesc;
  898.         StoreObj.options[ESix+17].text = EvCmpDesc;
  899.         outputLogEvent(StoreObj,ESix); // go output to Log Window if eligible
  900.         for ( var i=0; i<EventRecLength; i++ ) { // remove from temporary store
  901.             StoreObj.remove(ESix);   
  902.         }
  903.     }
  904. }
  905.  
  906. var LogEventBsy = false;
  907. /* Check if Event Passes Filter Test and if so, Output to Log Window */
  908. function outputLogEvent(ESObj,ESx) {
  909.     if ( ESObj != null ) 
  910.         return;
  911.     var warr = new Array();
  912.     var SLRec = new Array();
  913.     var warr1 = new Array();
  914.     
  915.       SLRec = ESx.split("~"); // parse the Log Record
  916.     if ( SLRec[0] == "SNMPTrap" ) { // process SNMPTrap Alert
  917.         EGid = SLRec[10]; // Alert Group ID
  918.         ECmn = curServAlertCompNme; // Computer Name
  919.         ECmd = curServAlertCompDesc; // Cmp Desc
  920.         EOn = EOvr = ""; // Obj Name, Over 
  921.         warr = SLRec[6].split("/"); // Time Stamp
  922.         warr[0] = ""+parseInt(warr[0],10);
  923.         warr[1] = ""+parseInt(warr[1],10);
  924.         
  925.         warr1 = warr[2].split(":");
  926.         warr1[1] = ( warr1[1].length > 1 ) ? warr1[1] : "0"+warr1[1];
  927.         warr1[2] = ( warr1[2].length > 1 ) ? warr1[2] : "0"+warr1[2];
  928.         warr[2] = warr1.join(":");
  929.     
  930.         ETs = warr.join("/");
  931.         Eid = SLRec[1]+"~"+SLRec[7]; // Event ID 
  932.         Ev = SLRec[8]; // Status Code = VB Count
  933.         
  934.         var VarBind = "";
  935.         if ( SLRec.length > 13 ) { // if Variable Binding info
  936.            var VBCount = parseInt( SLRec[11], 10 );
  937.            for ( var i=0; i<VBCount; i++ ) {
  938.                VarBind += SLRec[12+i+i];
  939.                VarBind += ", "+SLRec[13+i+i]+"; ";               
  940.             }
  941.         } 
  942.  
  943.         ECON = ECn = getOIDName(SLRec[2])+" ("+SLRec[2]+")";
  944.         if ( ECON.length > 60 ) {
  945.             ECONT = ECON; // set for display in the title
  946.             ECON = ECON.substring(0,60) + "...";   
  947.         }
  948.         else {
  949.               ECONT = "";
  950.         }
  951.      }
  952.     processAlertAudioOut(); // process AudioAlert
  953.  
  954.     /* Accomodate Names Larger than Field Size */    
  955.     if ( ECmn.length > 30 ) { // Computer Name
  956.         ECmnT = ECmn + "  / "; // set for display in the title
  957.         ECmn = ECmn.substring(0,30) + "...";   
  958.     }
  959.     else {
  960.        ECmnT = "";
  961.     }
  962.     if ( ECmd.charAt(ECmd.length-1) == "." ) {
  963.         ECmd = ECmd.substring(0,ECmd.length-1);
  964.     }
  965.     ECmnT +=  ECmd + " ("+SLRec[3]+")";
  966.     
  967.     if ((ELBgFlg ^= 1) == 0) {
  968.         FOps = "<div style='background-color:white'>";
  969.     }
  970.     else {
  971.         FOps = "<div style='background-color:e8e8e8'>";
  972.     }
  973.     FOps += "<table border='0' cellpadding='0' cellSpacing='1' width='100%'";
  974.     if ( EOvr == "0") { // if Event over threshold
  975.         FOps += " style='color:red'";
  976.     }
  977.     FOps += "><tr>";    
  978.     FOps += "<td width='160' colspan='1' align='left' class='optext' style='cursor:hand' title='" + ECmnT + "'>";
  979.     FOps += ECmn + "</td>";
  980.     FOps += "<td width='230' colspan='1' align='left' class='optext' style='cursor:hand' title='" + ECONT + "'>";
  981.     FOps += ECON + "</td>";
  982.     FOps += "<td width='104' colspan='1' align='left' class='optext'>";
  983.     FOps += ETs + "</td>";
  984.     FOps += "<td width='*' colspan='1' align='left' class='optext'>";
  985.     FOps += VarBind + " </td>"
  986.     FOps += "</tr></table></div>";
  987.     ELogText.insertAdjacentHTML("afterBegin",FOps);
  988.     //ELogWin.scrollIntoView();
  989.     ELogParams.logeventid += Eid + ","; // update the Event ID Array
  990.    //ClearButton.className = "BoxButton"; // enable button
  991.    ClearButton.disabled = ""; // enable button   
  992.    //StatusPrintButton.className = "BoxButton"; // enable button
  993.    StatusPrintButton.disabled = ""; // enable button   
  994.    LogEventBsy = false; // set free
  995. }
  996.  
  997. /* Get Alert Name from Store based on Alert ID */
  998. function getAlertNameSpecial(UID) {
  999.     AlertName = "";
  1000.     for (i=0, j=0; i < AlertStoreArr.length; ++j, i+=AlertRecLength) {
  1001.         if ( AlertStoreArr[i+1] == UID ) {
  1002.             AlertName = AlertStoreArr[i];
  1003.             AlertSelectIdx = j;
  1004.             break;
  1005.         }
  1006.     }
  1007.     return AlertName;
  1008. }
  1009.  
  1010. /* Get Event Name from Store based on Event ID */
  1011. function IsEventExist(EID) {
  1012.     ENobj = VA_EventStore; // get object
  1013.     for (var i=0, j=0; i < ENobj.length; ++j, i+=EventRecLength) {
  1014.         if ( ENobj.options[i].text == EID ) {
  1015.             EventSelectIdx = i;
  1016.             return true;
  1017.           }
  1018.     }
  1019.     return false;
  1020. }
  1021.  
  1022. /* Process Populate Configure Edit Fields */
  1023. var Tops = ""; // output string
  1024. var SBObj = null; // SelectBox Object for output
  1025. var CkCArr = new Array(); // "Checked" Computers array
  1026. var curServName = null; // Current Service Name
  1027. var CTparm = "optext"; // Computer Text Color
  1028. var CurrentAlertType = null;
  1029. function populateInput(idx) {
  1030.     SetCursor("wait");
  1031.     setSelectAll(false); // disable Select/UnselectAll buttons
  1032.     CurAlertName = AlertStoreArr[idx];
  1033.     CurAlertID = AlertStoreArr[idx+1];
  1034.     CurAlertDesc = AlertStoreArr[idx+2];
  1035.     CkCArr.length = 0; // init checked computer array
  1036.     curServName = ""; // initialize
  1037.     CountOfComps = 0; // clear
  1038.     // If Service, preset Start and End D to today
  1039.     var dob = new Date(); // get current d/t
  1040.     var calt = AlertStoreArr[idx+10];
  1041.     AlertStoreArr[idx+10] = "SNMPTrap";
  1042.     CurrentAlertType = "T"; // "SNMP Trap" type
  1043.  
  1044.     /* Check if Entry exists in the Filter */
  1045.     FilObj = VA_FilterStore; // Filter Store
  1046.     if ( getFilterEntry(CurAlertID) != null ) { // if entry in the filter
  1047.         i = FilterSelectIdx; // index to found entry
  1048.         CkCArr = FilObj.options[i+1].text.split(","); // get checked CIDs        
  1049.     }
  1050.     
  1051.    /* setup Object:Counter info for display */
  1052.    SBObj = VA_Select;
  1053.     SBObj.innerHTML = ""; // clear current display
  1054.  
  1055.     if ( CurrentAlertType == "T" ) { // if SNMP Trap
  1056.         if ( RpmCC_VA.SnmpTrapMonitorFindByAGId(CurAlertID) ) { // if unable to initiate request        
  1057.             ALupMode = "";
  1058.             top.Rstatus.Pstat("Unable to start the SNMP Computer LOOKUP request",true);
  1059.         }
  1060.         else {
  1061.             VA_CommBusy = 1; // set Comm busy flag
  1062.             CountOfCompsRcvd = 0; 
  1063.             CompIdLupArr = ""; // Computer Id Array
  1064.             ALupMode = "SNMPTrapComputerLookupPopIn"; // Mode
  1065.             top.Rstatus.Pstat("One moment while SNMP Computer LOOKUP request completes");
  1066.         }
  1067.     }
  1068. }
  1069. function setSelectAll(sFlag) {
  1070.     if ( sFlag ) { 
  1071.        SButtonState(bSelC,"0");
  1072.        SButtonState(bUselC,"0");
  1073.    }
  1074.    else { // otherwise disable the buttons
  1075.        SButtonState(bSelC,"1");
  1076.        SButtonState(bUselC,"1");
  1077.    }
  1078. }
  1079. function SButtonState(BtObj,BState) {
  1080.     //BtObj.className = (BState == "0") ? "BoxButton" : "BoxButtonD";
  1081.     BtObj.disabled = (BState == "0") ? "" : "disabled";
  1082. }
  1083.  
  1084. var CountOfCompsRcvd = 0;
  1085. function processPopulateSNMPTrapComputerse(coidstrg) {
  1086.     var SNMPTrapCompRecs = new Array;
  1087.     SNMPTrapCompRecs = coidstrg.split(";"); // parse out the Trap Monitor Computer records
  1088.     for ( var i=0; i<SNMPTrapCompRecs.length-1; i++ ) { // process out Trap Monitor records
  1089.         ++CountOfCompsRcvd;
  1090.         warr1 = SNMPTrapCompRecs[i].split("~"); // parse each record
  1091.         if ( i > 0 ) { // if not first one
  1092.              CompIdLupArr += ","; // Computer Id Array
  1093.         }
  1094.         CompIdLupArr += warr1[2]; // Computer Id Array
  1095.     }
  1096.     if ( CountOfCompsRcvd > 0 ) {
  1097.         MaxCmpCount = CountOfCompsRcvd;
  1098.         SBObj.style.overflow = ( CountOfCompsRcvd > 4 ) ? "scroll" : "";
  1099.         Tops = "<table border='0' cellpadding='0' cellSpacing='0' width='350'>";
  1100.         Tops += "<tr><td width='5'> </td>";
  1101.         Tops += "<td width='19' align='center'><img src='images/snmp_sm.gif' width='16' height='16'></td>";
  1102.         Tops += "<td width='*' class='optext'>SNMP Trap</td>";
  1103.         Tops += "</tr></table>";
  1104.         CountOfComps = 0; // initialize
  1105.         ALupMode = "EventPopIn";
  1106.         processPopulateInputCounterOpComplete(); // Start lookup for Computer Names/Descriptions
  1107.     }
  1108.     else {
  1109.         ALMode = ""; // reset mode
  1110.         top.Rstatus.Pstat("No associated computers found for this SNMP Trap alert",true);
  1111.     }
  1112. }    
  1113.  
  1114. var CountOfComps = 0;
  1115. var MaxCmpCount = 0;
  1116. var CompIdLupArr = "";
  1117. /* OpComplete for the CounterLookupForObjCounterArray */
  1118. function processPopulateInputCounterOpComplete() {
  1119.     if ( PopUpDiv.style.display == "none" )
  1120.         return; // exit if Configure Window no longer present
  1121.     /* Lookup Computer Names and Descriptions */
  1122.     if ( RpmCC_VA.ComputerLookupByIDArray(CompIdLupArr) ) {
  1123.         top.Rstatus.Pstat("Unable to start the Computer LOOKUP request",true);
  1124.         ALupMode = ""; // reset
  1125.     }
  1126.     else {
  1127.         VA_CommBusy = 1; // set Comm busy flag
  1128.         CountOfComps = 0; 
  1129.         top.Rstatus.Pstat("One moment while lookup request completes");
  1130.     }
  1131. }
  1132.  
  1133. function processPopulateInputComputer(Cid,CmpNme,CmpDesc) {
  1134.     if ( PopUpDiv.style.display == "none" )
  1135.         return; // exit if Configure Window no longer present
  1136.         
  1137.     /* Format Computer Name and Description */
  1138.         if ( CountOfComps+1 == MaxCmpCount ) { // if Last Computer for Display
  1139.            lineGIF = "L";
  1140.         }
  1141.         else {
  1142.              lineGIF = "T";
  1143.         } 
  1144.         /* if using from Filter Entry, determine if Checked */
  1145.         CkdS = "' checked='0' src='images/Unchecked.gif'"; // default
  1146.         var CImg = "Computer";
  1147.         if ( CkCArr.length > 0 ) { // if from Filter
  1148.             for ( var i=0; i<CkCArr.length; i++ ) {
  1149.                 if ( Cid == CkCArr[i] ) { // if this matches a Checked one
  1150.                      break;
  1151.                 }
  1152.             }
  1153.             if ( i < CkCArr.length ) { // if match versus Checked Array of IDs
  1154.                 CkdS = "' checked='1' src='images/Checked.gif'";
  1155.                 CImg = "SNMPTrapDisplaySm";
  1156.             }
  1157.         }
  1158.         Tops += "<table border='0' cellpadding='0' cellSpacing='0' width='350'>";
  1159.         Tops += "<tr><td width='39' height='20' align='right'><img src='images/" + lineGIF +".gif' width='19' height='20'></td>";
  1160.           Tops += "<td width='11' align='center'><img id='cmpa_" + CountOfComps;
  1161.           Tops += "' cmpid='" + Cid + CkdS;
  1162.           Tops += " style='cursor:hand' onclick='procCompImgClick(this)' width='9' height='9'></td>";
  1163.         Tops += "<td width='19' align='center'><img id='cmpb_" + CountOfComps;
  1164.         Tops += "' src='images/"+CImg+".gif' style='cursor:hand' onclick='procCompImgClick(this)' width='14' height='16' title='";
  1165.         Tops += CmpDesc + "'></td>";
  1166.         Tops += "<td width='*' class='"+CTparm+"'>" + CmpNme + "</td>";
  1167.         Tops += "</tr></table>";
  1168.         ++CountOfComps; // bump index
  1169. }
  1170.  
  1171. function processPopulateInputOpComplete() {
  1172.     /* Final Format and Output */
  1173.     if ( PopUpDiv.style.display == "none" )
  1174.         return; // exit if Configure Window no longer present
  1175.     ALupMode = ""; // reset
  1176.     SBObj.insertAdjacentHTML("beforeEnd",Tops);
  1177.  
  1178.     //DoneButton.className = "BoxButton"; // enable button
  1179.     DoneButton.disabled = ""; // enable button
  1180.     if ( CurrentAlertType != "U" ) {
  1181.         setSelectAll(true); // enable Select/UnselectAll buttons
  1182.     }
  1183.     SetCursor("auto");    
  1184.     if ( AL_AlertSel.style.display == "" && AL_AlertSel.style.visibility != "hidden") {
  1185.         top.Rstatus.Pstat("Request Completed");
  1186.  
  1187.         AL_AlertSel.focus(); // restore focus
  1188.     }
  1189. }
  1190.  
  1191. function procUsrAltClick(CObj) {
  1192.     if ( CObj.id != "usralt0" ) 
  1193.                 return;
  1194.     if ( CObj.checked == "1" ) { // if currently Checked, Uncheck
  1195.         usralt1.src = "images/Unchecked.gif";
  1196.        CObj.checked = "0"; // Set Unchecked
  1197.    }
  1198.     else { // otherwise Check
  1199.         usralt1.src = "images/Checked.gif";
  1200.        CObj.checked = "1"; // Set Checked
  1201.     }
  1202.     processApplyButton();
  1203. }
  1204.  
  1205. /* Process Click on Computer Image */
  1206. function procCompImgClick(COb) {
  1207.     isx = COb.id;  
  1208.     if ( isx.charAt(0) != "c" ) // if not a "cmpa_xx"
  1209.                 return;
  1210.     var cx = isx.substring(5,isx.length); // Strip off index
  1211.     CObj = document.all["cmpa_"+cx]; // Clicked Computer Entry
  1212.     var CIObj = document.all["cmpb_"+cx]; // Clicked Computer Entry Image
  1213.     
  1214.     if ( CObj.checked == "1" ) { // if currently Checked, Uncheck
  1215.         CObj.src = "images/Unchecked.gif";
  1216.        CObj.checked = "0"; // Set Unchecked
  1217.        CIObj.src = "images/Computer.gif";
  1218.    }
  1219.     else { // otherwise Check
  1220.         if ( CTparm == "optextr" ) { // if Suspended, don't add to filter
  1221.             top.Rstatus.Pstat("Alert is currently Suspended",true);    
  1222.             if ( AL_AlertSel.style.display == "" && AL_AlertSel.style.visibility != "hidden") {
  1223.                 AL_AlertSel.focus(); // restore focus
  1224.             }
  1225.             return;
  1226.         }
  1227.         CObj.src = "images/Checked.gif";
  1228.        CObj.checked = "1"; // Set Checked
  1229.        CIObj.src = "images/SNMPTrapDisplaySm.gif";
  1230.     }
  1231.     if ( arguments.length == 1 ) {
  1232.         processApplyButton();
  1233.     }
  1234. }
  1235.  
  1236.  
  1237. var TrapMonRecSize = 5;
  1238. function processEnumSnmpTrapMonitor(TMstrg) {
  1239.     var warr = new Array();
  1240.     var warr1 = new Array();
  1241.     // If done reading all records
  1242.     if ( TMstrg == "Done" ) {
  1243.         procOIDLookup(); // go lookup OID definitions
  1244.     }
  1245.     else {
  1246.         // Check if error
  1247.         warr1 = TMstrg.split(":");
  1248.         if ( warr1[0] == "Err" ) {
  1249.              top.Rstatus.Pstat("Error reading SNMP Trap Monitor records. "+TMstrg);
  1250.              return;
  1251.          }
  1252.          // Otherwise, process record
  1253.         else {
  1254.             warr = TMstrg.split("~");
  1255.               addElementToSelect(AC_TrapMonitorStore,warr[0]); // TrapMonitor ID
  1256.              addElementToSelect(AC_TrapMonitorStore,warr[2]); // Computer ID
  1257.               addElementToSelect(AC_TrapMonitorStore,warr[3]); // AlertGroup ID
  1258.               addElementToSelect(AC_TrapMonitorStore,""); // Save for Log ID
  1259.               addElementToSelect(AC_TrapMonitorStore,""); // Save for Variable Binding Info
  1260.          }
  1261.       }
  1262. }
  1263. function procOIDLookup() {
  1264.     // Get OID definitions
  1265.     if ( RpmCC_VA.EnumOidDefs() ) { // if unable to initiate request        
  1266.         top.Rstatus.Pstat("Unable to start the OID LOOKUP request",true);
  1267.         processResetButton();    
  1268.     }
  1269.     else { // waiting for OperationCompleteEvent
  1270.         top.Rstatus.Pstat("One moment while OID LOOKUP request completes");
  1271.     }
  1272. }
  1273. var gOIDstrg = "";
  1274. var gOIDarray = new Array();
  1275. function processOIDLookupRecord(OIDstrg) {
  1276.     gOIDstrg = OIDstrg; // save
  1277.     gOIDarray = OIDstrg.split("~"); // parse
  1278.     AL_AlertSel.style.display = ""; // compnesate for IE 5.5 bug; see "hideAlertSel()" below
  1279.     
  1280.     // Done
  1281.     ALupMode = "";
  1282.       processResetButton();            
  1283.       //ConfigButton.className = "BoxButton"; // enable button
  1284.       ConfigButton.disabled = ""; // enable button   
  1285.       //ViewCurrentButton.className = "BoxButton"; // enable button
  1286.       ViewCurrentButton.disabled = ""; // enable button   
  1287.     top.Rstatus.Pstat("Request Completed");
  1288.     processValidateFilter(); // go validate the Alert Filter
  1289.     if ( IsDBChange == false ) {
  1290.         processMostRecentHoursLookup();
  1291.     }
  1292.     IsDBChange = false;
  1293.     processAccumulatedAlerts(); // go process the accumulated Alerts
  1294.     top.banner.processStopCommX(); 
  1295.     Tid = setTimeout("hideAlertSel()",50); // Delay 50 ms. then try to hide AlertSel
  1296. }
  1297. // compensate for IE 5.x bug
  1298. function hideAlertSel() {
  1299.     Tid = null;
  1300.     AL_AlertSel.style.display = "none";
  1301. }
  1302.  
  1303. function getOIDName(coid) {
  1304.     for ( var i=0; i<gOIDarray.length-1; i+=4 ) {
  1305.         if ( gOIDarray[i+2] == coid ) { // if match
  1306.             return gOIDarray[i+1];    
  1307.         }
  1308.     }
  1309.     return coid;
  1310. }
  1311.  
  1312. // Add Computer to Store if Not Already
  1313. var CompRecLength = 3;
  1314. function processCompAddToStore(CNme,CDesc,Cid) {
  1315.     for ( var i=0; i<AC_CompStoreArr.length; i+=CompRecLength ) {
  1316.         if ( Cid == AC_CompStoreArr[i] ) { // if in Store, skip it
  1317.             return;
  1318.         }
  1319.     }
  1320.     // Not in Store, Add now
  1321.     AC_CompStoreArr[i++] = Cid; 
  1322.     AC_CompStoreArr[i++] = CNme; 
  1323.     AC_CompStoreArr[i] = CDesc; 
  1324. }
  1325. var curCompDesc = "";
  1326. function getCompNameDesc(CompID) {
  1327.     for ( var i=0; i<AC_CompStoreArr.length; i+=CompRecLength ) {
  1328.         if ( CompID == AC_CompStoreArr[i] ) { // if in Store
  1329.             // save Computer Name and Description
  1330.             curServAlertCompDesc = AC_CompStoreArr[i+2];
  1331.             curServAlertCompNme = AC_CompStoreArr[i+1]; 
  1332.             return true;
  1333.         }
  1334.     }
  1335.     return false;
  1336. }
  1337.  
  1338. // Process to Toggle the Hide and Show of the Banner & Menu Frames
  1339. var hideToggle = 0;
  1340. var TitleDivSize = 100;
  1341. function processBannerMenu() {
  1342.     if ( hideToggle == 0 ) {
  1343.         top.BannerMenuHide(); hideToggle = 1;   
  1344.         ViewAlertsTitleDiv.style.display = "none"; 
  1345.         TitleDivSize = 56; 
  1346.     }
  1347.     else {
  1348.         top.BannerMenuShow(); hideToggle = 0;   
  1349.         ViewAlertsTitleDiv.style.display = "";  
  1350.         TitleDivSize = 100;
  1351.     }   
  1352. }
  1353.  
  1354. // Process SelectALL or UnselectALL
  1355. function processSelect(Pflg) {
  1356.     var CObj = null;
  1357.     for ( var j=0, i=0; j<CountOfComps; j++ ) {
  1358.         CObj = document.all["cmpa_"+j]; // computer entry in tree
  1359.         if (CObj.checked == Pflg) {
  1360.             procCompImgClick(CObj,true); // go process
  1361.             ++i; // bump number changed
  1362.         }
  1363.     }
  1364.     if ( i > 0 ) {
  1365.         processApplyButton();
  1366.     }
  1367.     if ( AL_AlertSel.style.display == "" && AL_AlertSel.style.visibility != "hidden") {
  1368.         AL_AlertSel.focus(); // restore focus
  1369.     }
  1370. }
  1371.     
  1372. // Null funcs
  1373. function    processResetButton() { 
  1374.     top.banner.processStopCommX(); 
  1375. }
  1376. function    checkEnableSchedButton() { 
  1377. }
  1378.  
  1379. function PopUpContextOpen() {
  1380.     AL_AlertSel.style.visibility = "hidden";
  1381. }
  1382. function PopUpContextClose() {
  1383.     AL_AlertSel.style.visibility = "visible";
  1384. }
  1385.  
  1386. //-->
  1387. </script>
  1388.  
  1389. <script LANGUAGE="JAVASCRIPT" SRC="js/Calendar.js" PURPOSE="COMPONENT" CLASSNAME="com.netobjects.Calendar"></script>
  1390. <script LANGUAGE="JavaScript" src="js/MiscFunc.js"></script>
  1391. <script LANGUAGE="JavaScript" src="js/ButtonFunc.js"></script>
  1392. <script LANGUAGE="JavaScript" src="js/CalendarTimeFunc.js"></script>
  1393. <script LANGUAGE="JavaScript" src="js/AlertFunc.js"></script>
  1394. <script LANGUAGE="JavaScript" src="js/WinServicesFunc.js"></script>
  1395.  
  1396. <script LANGUAGE="JavaScript" FOR="RpmCC_VA" EVENT="Connected()">
  1397. <!--
  1398. processConnectConfirmed();
  1399. //-->
  1400. </script> 
  1401.  
  1402. <script LANGUAGE="JavaScript" FOR="RpmCC_VA" EVENT="DBChanged(cdata)">
  1403. <!--
  1404. var warr = new Array();
  1405. warr = cdata.split("~"); // parse the event data
  1406. // Ignore if Server Table change
  1407. if ( warr[0] == "4" ) 
  1408.     return; // ignore
  1409. top.Rstatus.StatDB.style.display = "";
  1410. if ( CTid == null ) {
  1411.     CTid = setTimeout("processDBChanged()",30000); // Delay 30 secs then process
  1412. }
  1413. //-->
  1414. </script>
  1415.  
  1416. <script LANGUAGE="JavaScript" FOR="RpmCC_VA" EVENT="Disconnected()">
  1417. <!--
  1418. top.Rstatus.Pstat("Disconnected",true);
  1419. if ( Tid != null ) {
  1420.     clearTimeout(Tid); // stop timeout routine
  1421. }
  1422. Tid = setTimeout("processReconnect()",10000); // Delay 10 secs then try reconnnect
  1423. //-->
  1424. </script>
  1425.  
  1426.  
  1427. <script LANGUAGE="JavaScript" FOR="RpmCC_VA"
  1428. EVENT="AlertGroupLookupRecordPart1(AlID, AlName, AlDesc, AlThresh, AlOver, AlEveryTime, AlDur, AlSched, AlSDT, AlEDT, AlArrayIDs)">
  1429. <!--
  1430. AlertLupRecPart1(AlID, AlName, AlDesc, AlThresh, AlOver, AlEveryTime, AlDur, AlSched, AlSDT, AlEDT, AlArrayIDs);
  1431. //-->
  1432. </script>
  1433.  
  1434. <script LANGUAGE="JavaScript" FOR="RpmCC_VA"
  1435. EVENT="AlertGroupLookupRecordPart2(AlID, AlRunProg, AlProgNme, AlProgramArgs, AlENotify, AlEAddr, AlESubj, AlPhNotify, AlPhNumber, AlTextToSpeak, AlPgNotify, AlPgNumber, AlTextToSend)">
  1436. <!--
  1437. AlertLupRecPart2(AlID, AlRunProg, AlProgNme, AlProgramArgs, AlENotify, AlEAddr, AlESubj, AlPhNotify, AlPhNumber, AlTextToSpeak, AlPgNotify, AlPgNumber, AlTextToSend);
  1438. //-->
  1439. </script>
  1440.  
  1441. <script LANGUAGE="JavaScript" FOR="RpmCC_VA" EVENT="AlertGroupOpComplete()">
  1442. <!--
  1443. processAlertOpComplete();
  1444. VA_CommBusy = 0; // reset Comm busy flag
  1445. //-->
  1446. </script> 
  1447.  
  1448. <script LANGUAGE="JavaScript" FOR="RpmCC_VA" EVENT="AlertGroupOpError()">
  1449. <!--
  1450. processAlertOpError();
  1451. VA_CommBusy = 0; // reset Comm busy flag
  1452. //-->
  1453. </script> 
  1454.  
  1455. <script LANGUAGE="JavaScript" FOR="RpmCC_VA"
  1456. EVENT="AlertEventLookupRecord1(EvID, EvTimStmp, EvValue, EvThresh, EvOver, EvDur, EvEmNotify, EvPhNotify, EvProNotify, EvPgNotify, EvObjNme, EvCntNme, EvCmpNme)">
  1457. <!--
  1458. AlertEventLupRec1(EvID, EvTimStmp, EvValue, EvThresh, EvOver, EvDur, EvEmNotify, EvPhNotify, EvProNotify, EvPgNotify, EvObjNme, EvCntNme, EvCmpNme);
  1459. //-->
  1460. </script>
  1461.  
  1462. <script LANGUAGE="JavaScript" FOR="RpmCC_VA"
  1463. EVENT="AlertEventLookupRecord2(EvID, EvAlertID, EvValueID, EvAlGrpID, EvObjID, EvCntrID, EvCmpID, EvGrpID, EvServerID, EvObjDesc, EvCntrDesc, EvCmpDesc, EvOSver)">
  1464. <!--
  1465. AlertEventLupRec2(EvID, EvAlertID, EvValueID, EvAlGrpID, EvObjID, EvCntrID, EvCmpID, EvGrpID, EvServerID, EvObjDesc, EvCntrDesc, EvCmpDesc, EvOSver);
  1466. //-->
  1467. </script>
  1468.  
  1469. <script LANGUAGE="JavaScript" FOR="RpmCC_VA" EVENT="ComputerLookupRecord(Cid,Gid,SrvID,Nme,Desc,Pswd,OSVer,Addr,Port)">
  1470. <!--
  1471. processCompAddToStore(Nme,Desc,Cid);
  1472. if ( ALupMode == "AlertEvent" ) {
  1473.     processAlertServicesComputerLookup(Cid,Nme,Desc);
  1474. }
  1475. else if ( ALupMode == "EventPopIn" ) {
  1476.     processPopulateInputComputer(Cid,Nme,Desc);
  1477. }
  1478. //-->
  1479. </script> 
  1480.  
  1481. <script LANGUAGE="JavaScript" FOR="RpmCC_VA" EVENT="ComputerOpComplete()">
  1482. <!--
  1483. if ( ALupMode == "EventPopIn" ) {
  1484.     processPopulateInputOpComplete();
  1485. }
  1486. VA_CommBusy = 0; // reset Comm busy flag
  1487. //-->
  1488. </script> 
  1489.  
  1490. <script LANGUAGE="JavaScript" FOR="RpmCC_VA" EVENT="ComputerOpError()">
  1491. <!--
  1492. processComputerOpError();
  1493. VA_CommBusy = 0; // reset Comm busy flag
  1494. //-->
  1495. </script> 
  1496.  
  1497. <script LANGUAGE="JavaScript" FOR="RpmCC_VA" EVENT="StartCommunication()">
  1498. <!--
  1499. top.banner.processStartComm();
  1500. //-->
  1501. </script> 
  1502.  
  1503. <script LANGUAGE="JavaScript" FOR="RpmCC_VA" EVENT="StopCommunication()">
  1504. <!--
  1505. top.banner.processStopComm();
  1506. //-->
  1507. </script> 
  1508.  
  1509. <script LANGUAGE="JavaScript" FOR="RpmCC_VA" EVENT="EnumSnmpTrapMonitor(TMstrg)">
  1510. <!--
  1511. VA_CommBusy = 0; // reset Comm busy flag
  1512. processEnumSnmpTrapMonitor(TMstrg);
  1513. //-->
  1514. </script> 
  1515. <script LANGUAGE="JavaScript" FOR="RpmCC_VA" EVENT="SnmpTrapLogRecord(STLData)">
  1516. <!--
  1517. VA_CommBusy = 0; // reset Comm busy flag
  1518. WarningBox.style.display = "none";
  1519. WarningBox1.style.display = "none";
  1520. if ( STLData == "GetLast" ) {
  1521.     WarningBox1.style.display = "";   
  1522. }
  1523. else {
  1524.     processAlertSNMPRecord(STLData);
  1525. }
  1526. //-->
  1527. </script> 
  1528. <script LANGUAGE="JavaScript" FOR="RpmCC_VA" EVENT="SnmpTrapMonitorFindByAGId(coidstrg)">
  1529. <!--
  1530. processPopulateSNMPTrapComputerse(coidstrg);
  1531. //-->
  1532. </script> 
  1533. <script LANGUAGE="JavaScript" FOR="RpmCC_VA" EVENT="EnumOidDefs(ostrg)">
  1534. <!--
  1535. processOIDLookupRecord(ostrg);
  1536. //-->
  1537. </script> 
  1538.  
  1539.  
  1540.  
  1541.  
  1542. <script LANGUAGE="JavaScript" src="js/PopUpMenuFunc.js"></script>
  1543.  
  1544. <object ID="RpmCC_VA" NAME="RpmCC_VA" WIDTH="14" HEIGHT="1" style="display:none"
  1545. CLASSID="CLSID:D88C2358-FC83-11D1-BF49-00104B2D6F80" CODEBASE="controls/RPMComm.cab#version=5,2,0,0">
  1546.   <param name="_Version" value="65536">
  1547.   <param name="_ExtentX" value="2646">
  1548.   <param name="_ExtentY" value="1341">
  1549.   <param name="_StockProps" value="0">
  1550. </object>
  1551.  
  1552. <!-- Invisible Object to Support Simulated Click Event -->
  1553. <button id="FakeBut" style="display:none" onclick="top.banner.savePageCoord(event,document.body,'ViewSNMPTrapDisplay')">
  1554. </button>
  1555.  
  1556. <!-- Define Images used in dynamic HTML generation to force loading and caching now -->
  1557. <div style="display:none">
  1558. <img src="images/SNMPTrapDisplaySm.gif"><img src="images/Counter.gif"><img src="images/Unchecked.gif">
  1559. <img src="images/monitoritalert.gif"><img src="images/Computer.gif"><img src="images/L.gif">
  1560. <img src="images/Checked.gif"><img src="images/T.gif"><img src="images/Objects.gif">
  1561. <img src="images/sAdminServers.gif">
  1562. </div>
  1563.  
  1564.  <!-- PopUp to Prompt to Configure the Alert Filter -->
  1565.    <div id="PopUpDiv" class="PopUpBox" style="display:none; left:150; top:150; ">
  1566.    
  1567. <span id="ELogConfigLine" >
  1568. <center height="28" style="width:500; font-weight:800; font-size:10pt; background-color:graytext; color:captiontext" >Configure SNMPTrapWatch Display Filter</center>
  1569.  <center><div class="EventConfig" id="ELogConfig" style="width:500px;" align="center">
  1570.  <table border="0" width="500" >
  1571.       <tr>
  1572.         <td width="90" align="right" class="inputlabel" height="32">Watch/Alert:</td>
  1573.             <td width="390" align="left" height="1">
  1574.             <select ONCHANGE="processAlertName()" SIZE="1" NAME="AL_AlertSel" id="AL_AlertSel" class="idis" style="width: 185pt" style="display: none"></select></td>
  1575.              <select SIZE="1" NAME="AC_TrapMonitorStore" style="display: none"></select>  
  1576.      </tr>
  1577.       <tr style="display:none">
  1578.         <td width="90" align="right" class="inputlabel" height="32">Start Date:</td>
  1579.           <td width="390" align="left" height="1"><input TYPE="text" SIZE="17" style="font-weight: 500" NAME="VA_StartDate" calendar="VA_calwin" CalObj="" onClick="this.blur(); processCalendarClick(this)" style="cursor:hand"> </td>
  1580.       </tr>
  1581.         <tr style="display:none">
  1582.         <td width="90" align="right" height="1"></td>
  1583.         <td width="390" align="left" height="1"><div class="CalendarTextBox" Name="VA_calwin" ID="VA_calwin" CalState="0" style="display: none"></div></td>
  1584.       </tr>
  1585.       
  1586.        <tr style="display:none">
  1587.        <td width="90" align="right" class="inputlabel" height="1">Stop Date:</td>
  1588.           <td width="390" align="left" height="1"><input TYPE="text" SIZE="17" style="font-weight: 500" NAME="VA_StopDate" onClick="this.blur(); processCalendarClick(this)" style="cursor:hand" CalObj="" calendar="VA_scalwin"></td>
  1589.       </tr>
  1590.         <tr style="display:none">
  1591.         <td width="90" align="right" height="1"></td>
  1592.         <td width="390" align="left" height="1"><div class="CalendarTextBox" Name="VA_scalwin" ID="VA_scalwin" CalState="0" style="display: none"></div></td>
  1593.       </tr>
  1594.    
  1595.       <tr>
  1596.         <td width="90" align="right" class="inputlabel" height="1">Selection(s):</td>
  1597.         <td width="390" align="left" height="1">
  1598.           <div id="VA_Select" class="VASelectBox"></div>
  1599.           </td>
  1600.       </tr>
  1601.     </table></div><table border="1" cellspacing="1" cellpadding="1" height="40" width="500">
  1602.    <tr><td align="left" width="20%" class="inputlabel">  Show On Open<br>  Last <select onchange="processMostRecentHours()" id="lasthours"></select> Hrs</td><td width="80%" align="center"><button onclick="processSelect('0')" style="font-family:arial; font-size : 8pt; font-weight : 600; cursor:hand" style="width:80px; height:28px" id="bSelC" ><img src="images/selectall.gif" align="absmiddle" height="15" width="14">Select All</button>  <button onclick="processSelect('1')" style="font-family:arial; font-size : 8pt; font-weight : 600; cursor:hand" style="width:93px; height:28px" id="bUselC" ><img src="images/unselectall.gif" align="absmiddle" height="15" width="14">Unselect All</button>  <button id="DoneButton" style="font-family:arial; font-size : 8pt; font-weight : 600; cursor:hand" title="Cancel and Hide the Configure Filter" style="width:70px; height:28px" onClick="processDoneButton()"><img src="images/CloseImg.gif" align="absmiddle" height="14" width="15"> Close</button></td></tr>
  1603.     </table></center></span>
  1604.     
  1605.        </div>
  1606.  <!-- End of PopUp to Prompt to Configure the Alert Filter -->
  1607.  
  1608.  
  1609.  
  1610. <center>
  1611.  
  1612.  <div id="VA_MainBox" class="VAMainBox" style="display:none">
  1613.  
  1614.   <div id="ViewAlertsTitleDiv"><table border="1"  borderColor="activeborder" align="left">
  1615.   <table border="1"  borderColor="activeborder" align="left">
  1616.     <tr><td borderColorDark="graytext" borderColorLight="white" style="font-weight:800; font-size:12pt; background-color:threedhighlight; color:windowtext"> <img src="images/SNMPTrapDisplaySm.gif" align="absmiddle" height="16" width="16"> SNMPTrapWatch Display </td></tr>
  1617. </table>
  1618. <BR CLEAR=ALL><HR align="left"></div>
  1619.  
  1620.  <!-- Alert Event Log Window -->
  1621. <center class="inputlabel">SNMPTrapWatch Display</center>
  1622. <div class="EventLog" ID="ELogWin" style="width:99%" align="center">
  1623. <center><div style="display:none; width:100%" id="WarningBox" align="center"><table border="0" cellpadding="0" cellspacing="2">
  1624.   <tr>
  1625.     <td width="43"><img src="images/HourGlass.gif" width="32" height="32" alt="Please Wait!" align="bottom" border="0"></td>
  1626.     <td width="*" style="font-family:Arial; font-size:10pt; font-weight:bold; color:infotext">Please Wait For Most Recent SNMPTrap Log Messages!</td>
  1627.   </tr>
  1628. </table>
  1629. </div>
  1630. <div style="display:none; width:100%" id="WarningBox1" align="center"><table border="0" cellpadding="0" cellspacing="2">
  1631.   <tr>
  1632.     <td width="*" style="font-family:Arial; font-size:10pt; font-weight:bold; color:red">There Are No Most Recent SNMPTrap Log Messages Available!</td>
  1633.   </tr>
  1634. </table>
  1635. </div></center>
  1636. <span id="ELogText"></span><select SIZE="1" NAME="ELogParams" logeventid="" logtime="0" ELBgFlg=0 style="display: none"></select></div>
  1637.  <div style="height:0px; width:99%" align="center">
  1638.    <select SIZE="1" NAME="VA_EventStore" style="display: none"></select>
  1639.    <select SIZE="1" NAME="VA_ServEventStore" style="display: none"></select>
  1640.    <select SIZE="1" NAME="VA_UserEventStore" style="display: none"></select>
  1641.    <select SIZE="1" NAME="VA_CounterEventStore" style="display: none"></select>
  1642.    <table border="1" cellspacing="1" cellpadding="1" height="40" width="100%">
  1643.     <tr>
  1644.       <td width="15%" align="left" class="inputlabel"><span title="Uses the 'Asterisk' WAV assignment in Control Panel->Sounds & Multimedia Properties"><INPUT TYPE="checkbox" NAME="AlertAudioEnabled" id="AlertAudioEnabled" class="inputlabel" CHECKED>Audio Alert</span></td>
  1645.         <td align="center" width ="70%"><button id="ViewCurrentButton" style="font-family:arial; font-size : 8pt; font-weight : 600; cursor:hand" title="View Filter for Alerts and associated Events displayed in the Event Log" style="width:90px; height:29px" onClick="processViewCurrentButton()" disabled><img src="images/OpenImg.gif" align="absmiddle" height="14" width="15"> View Filter</button> <button id="ConfigButton" style="font-family:arial; font-size : 8pt; font-weight : 600; cursor:hand" title="Configure Filter for Alerts and associated Events displayed in the Event Log" style="width:120px; height:29px" onClick="processConfigureButton()" disabled><img src="images/ConfigImg.gif" align="absmiddle" height="18" width="17">Configure Filter</button> <button id="ClearButton" style="font-family:arial; font-size : 8pt; font-weight : 600; cursor:hand" title="Clear the Event Log" style="width:90px; height:29px" onClick="processClearButton()" disabled><img src="images/unselectall.gif" align="absmiddle" height="15" width="14"> Clear Log</button> <button id="StatusPrintButton" title="Print AlertWatch Status Log" onclick="if (this.bdis == '0') processPrintStatus();" bdis="0" style="width:90px; height:29px" style="font-family:arial; font-size : 8pt; font-weight : 600; cursor:hand" DISABLED><img src="images/Printer.gif" align="absmiddle" height="15" width="17"> Print</button></td>
  1646.      <td width="15%" align="right"><button onclick="processBannerMenu()" title="Press to Toggle Hide/Show of Menu and Banner Frames" style="cursor:hand"><img src="images/FullView.gif" align="absmiddle" height="16" width="16"></button></td></tr></table></div>
  1647.  
  1648.  
  1649.  
  1650.    
  1651. <!-- Alert Filter Window-->
  1652. <span id="ELogViewCurLine" style="display:none"><HR align="left">
  1653. <center class="inputlabel" >SNMPTrapWatch Display Filter</center>
  1654.  <div class="EventFilter" ID="ELogViewCur" style="height:110px; width:530px; " align="center">
  1655.     <select SIZE="1" NAME="VA_FilterStore" style="display: none"></select>
  1656.         </div>
  1657.   <table border="1" cellspacing="1" cellpadding="1" height="40" width="40%">
  1658.    <tr><td align="center"><button id="VC_DeleteButton" disabled="disabled" style="font-family:arial; font-size : 8pt; font-weight : 600; cursor:hand" title="Delete the Selected Filter Entry and stop display of associated Events in the Event Log" style="width:100px; height:28px" onClick="processDeleteEntryButton()"><img src="images/DelImg.gif" align="absmiddle" height="14" width="14">Delete Entry</button>  <button style="font-family:arial; font-size : 8pt; font-weight : 600; cursor:hand" title="Hide the Filter Display" style="width:100px; height:28px" onClick="processHideCurrentButton()"><img src="images/collapse.gif" align="absmiddle" height="14" width="16">Collapse</button></td></tr>
  1659.     </table></span>
  1660.  
  1661.   <!--<div style="height:3px; width:92%" align="center"></div>-->
  1662.  
  1663.  </center></div>
  1664.  
  1665. </center>
  1666. </body>
  1667. </html>
  1668.